<h1 matDialogTitle>{{ 'Clone to New Dataset' | translate }}</h1>
<mat-dialog-content>
@if (!wasDatasetCloned) {
  <form
    class="ix-form-container"
    [formGroup]="form"
    (submit)="onSubmit()"
  >
    <ix-input
      formControlName="dataset_dst"
      [label]="'Dataset' | translate"
      [required]="true"
      [tooltip]="tooltips.dataset_dst | translate"
    ></ix-input>

    <ix-form-actions>
      <button
        *ixRequiresRoles="requiredRoles"
        mat-button
        type="submit"
        color="primary"
        ixTest="clone"
        [disabled]="form.invalid"
      >
        {{ 'Clone' | translate }}
      </button>
      <button mat-button type="button" ixTest="cancel" matDialogClose>
        {{ 'Cancel' | translate }}
      </button>
    </ix-form-actions>
  </form>
} @else {
  <p>{{ 'Dataset {name} was created.' | translate: { name: datasetName } }}</p>

  <ix-form-actions>
    <button mat-button type="button" ixTest="close" matDialogClose>
      {{ 'Close' | translate }}
    </button>

    <a
      mat-button
      type="submit"
      color="primary"
      ixTest="go-to-datasets"
      matDialogClose
      [routerLink]="['/datasets']"
    >
      {{ 'Go to Datasets' | translate }}
    </a>
  </ix-form-actions>
}
</mat-dialog-content>
